<%
// 默认皮肤样式名称：详见jeesite-common项目下的static/adminlte/css/skins目录
var defaultSkinName = @Global.getConfig('sys.index.skinName', 'skin-blue-light');
// 从cookie里获取样式名，取不到使用默认样式
var skinName = cookie('skinName_'+user.userCode, false, defaultSkinName);
// 侧边栏的默认显示样式：1：默认显示侧边栏；2：默认折叠侧边栏
var sidebarStyle = @Global.getConfig('sys.index.sidebarStyle', '1');
var sidebarCollapse = (sidebarStyle == '2' ? 'sidebar-collapse' : '');
var bodyClass = 'fixed noscroll2 sidebar-mini ' + sidebarCollapse;
%>
<% layout('/layouts/default.html', {title: '', bodyClass: bodyClass, libs: ['tabPage']}){ %>
<% include('/include/upgrade.html'){} // 如果客户浏览器版本过低，则显示浏览器升级提示。 %>
<link rel="stylesheet" href="${ctxStatic}/jquery-toastr/2.0/toastr.min.css?${_version}">
<link rel="stylesheet" href="${ctxStatic}/adminlte/css/skins/${skinName}.css?${_version}">
<link rel="stylesheet" href="${ctxStatic}/modules/sys/sysIndex.css?${_version}">
<header class="main-header">    
	<% include('sysIndex/topMenu.html'){} %>
</header>
<aside class="main-sidebar">
	<% include('sysIndex/leftMenu.html'){} %>
</aside>
<script>
    $(function () {
        if(window.screen.width < 900){//手机屏幕
            showPcIcon();
            switchDevice("mobile");
        }else{
            showMobileIcon();
            switchDevice("pc");
        }
    });

    function showMobileIcon(){
        $("#mobilePage").show();
        $("#pcPage").hide();
    }

    function showPcIcon(){
        $("#mobilePage").hide();
        $("#pcPage").show();
    }

    $("#mobilePage").click(function () {
        showPcIcon();
        switchDevice("mobile");
        tabPageReload();
    });

    $("#pcPage").click(function () {
        showMobileIcon();
        switchDevice("pc");
        tabPageReload();
    });

    function switchDevice(deviceType){
        $.ajax({
            type: "GET",
            url: '${ctx}/vip/agent/deviceType',
            data: {//上传参数
                deviceType: deviceType,
            },
            dataType: "text",
            success: function (data) {
                console.log(data)
            },
            error: function (jqObj) {
                console.log(jqObj.status)
            }
        });
    }

    function tabPageReload(){
        console.log("tabPageReload");
        $('.html_content').each(function () {
            if($(this).is(':visible')){
                $(this).find("iframe")[0].contentWindow.pageReload();
            }
        })
    }
</script>
<div class="content-wrapper">
	<div id="tabpanel"></div>
</div>
<% } %>

<% if(hasRoles('1000')){ %>
<div class="hide" id="desktopTabPage" data-title="${text('首页')}" data-url="${ctx}/vip/agent/list"></div>
<% } %>
<% if(hasRoles('1001,1003,1005')){ %>
<div class="hide" id="desktopTabPage" data-title="${text('首页')}" data-url="${ctx}/vip/member/list"></div>
<% } %>
<% if(hasRoles('1006,1004')){ %>
<div class="hide" id="desktopTabPage" data-title="${text('首页')}" data-url="${ctx}/vip/record/reviewList"></div>
<% } %>
<% if(hasRoles('1007')){ %>
<div class="hide" id="desktopTabPage" data-title="${text('首页')}" data-url="${ctx}/vip/record/createReport"></div>
<% } %>
<div class="hide" id="modifyPasswordTip" data-message="${modifyPasswordTip!}"></div>
<script src="${ctxStatic}/jquery-toastr/2.0/toastr.min.js?${_version}"></script>
<script src="${ctxStatic}/jquery-plugins/jquery.slimscroll.js"></script>
<script src="${ctxStatic}/modules/sys/sysIndex.js?${_version}"></script>
